﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
//using com.sun.org.apache.bcel.@internal.generic;
//using IService;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using X.PagedList;
namespace Project.AdminWeb.Areas.Member.Controllers
{
    [Area("Member")]

    public class MemberController : Controller
    {
        private readonly ILogger<MemberController> _logger;
        //private readonly IUserAppService _userAppService;
        public MemberController(ILogger<MemberController> logger)
        {
            _logger = logger;
            //_userAppService = userAppService;
        }



        // [ResponseCache(Duration = 1000)]
        public IActionResult Index(int page = 1, int pageSize = 10)
        {
            //return Redirect("/temp/index.html");

            // string sql = @$"SELECT Id,INSERT(fullName,2,1,'*') fullName,HeadImg,INSERT(Mobile ,4,4,'****') Mobile ,case Sex
            // when 1 then '男'
            // else '女'
            // end Sex,RegTime,Integral,INSERT(Email ,4,4,'****') Email
            // FROM TMember ORDER BY id LIMIT {(page - 1) * 10},{pageSize}";
            //// var table = _userAppService.GetDataTableAsync(sql).Result;
            //// var total  =_userAppService.GetDataTableAsync("select count(id) TotalCount from TMember").Result.Rows[0][0];
            // //  _logger.LogError(sql);
            // IPagedList pageList = new PagedList<DataRow>(table.Select(), page, pageSize,Convert.ToInt32( total));
            // if (Request.Headers.ContainsKey("x-requested-with"))
            // {
            //     return View("_Table", pageList);
            // }
            // return View(pageList);
            return View();
        }


    }
}